home *** CD-ROM | disk | FTP | other *** search
/ Developer CD Series 2000 November: Tool Chest / Dev.CD Nov 00 TC Disk 1.toast / Sample Code / Contributed / SpriteWorld / SpriteWorld Files / MPW / SpriteWorldLib.make < prev    next >
Encoding:
Text File  |  2000-10-06  |  5.6 KB  |  206 lines  |  [TEXT/R*ch]

  1. #-----------------------------------------------------------------------
  2. #    Makefile for MPW (Macintosh Programmers Workshop by Apple)
  3. #
  4. #   Project:    SpriteWorldLib
  5. #   File:       SpriteWorldLib.make
  6. #
  7. #    Targets:    All (default), Debug, Final
  8. #                 Clean (remove objects), Clean-All (remove binaries)
  9. #                
  10. #    Written by Anders F Björklund <afb@algonet.se>
  11. #-----------------------------------------------------------------------
  12.  
  13. Makefile          = "SpriteWorldLib.make"        # high-level make (this file)
  14. MakeOutput          = "SpriteWorldLib.makelow"    # low-level make (built by this file)
  15.  
  16. SpriteWorldLib    ƒ    All                        # Default High-Level Target
  17. All                ƒ    Debug Final
  18. Debug             ƒ    68K.Debug PPC.Debug
  19. Final             ƒ    68K.Final PPC.Final
  20. Clean            ƒ    Clean.Debug Clean.Final
  21. Clean-All        ƒ    Clean-All.Debug Clean-All.Final
  22.  
  23. #----------------------------------------------------
  24.  
  25. Tgt                =    #
  26. Opt                =    #
  27. Sym                =    #
  28. Dbg                =    #
  29. Mbg                =    #
  30.  
  31. Common =         -f {Makefile}
  32.                 
  33. Debug =         -d    Tgt=Debug ∂
  34.                 -d    Opt=off ∂
  35.                 -d    Sym=on ∂
  36.                 -d    Dbg=Debug
  37.             
  38. Final =         -d    Tgt=Final ∂
  39.                 -d    Opt=speed ∂
  40.                 -d    Sym=off ∂
  41.                 -d    Dbg=
  42.  
  43. Debug68K =        {Common} {Debug} -d Mbg="-mbg on"
  44. DebugPPC =        {Common} {Debug} -d Mbg="-tb on"
  45. Final68K =        {Common} {Final} -d Mbg="-mbg off"
  46. FinalPPC =        {Common} {Final} -d Mbg=""
  47.  
  48. #----------------------------------------------------
  49. # The high-level targets
  50. #----------------------------------------------------
  51.  
  52. 68K.Debug         ƒ    $OutOfDate
  53.     Make -d Binary=68K {Debug68K} 68K >{MakeOutput}
  54.     Execute {MakeOutput}
  55.     Delete {MakeOutput}
  56.     
  57. PPC.Debug         ƒ    $OutOfDate
  58.     Make -d Binary=PPC {DebugPPC} PPC >{MakeOutput}
  59.     Execute {MakeOutput}
  60.     Delete {MakeOutput}
  61.     
  62. 68K.Final         ƒ    $OutOfDate
  63.     Make -d Binary=68K {Final68K} 68K >{MakeOutput}
  64.     Execute {MakeOutput}
  65.     Delete {MakeOutput}
  66.     
  67. PPC.Final         ƒ    $OutOfDate
  68.     Make -d Binary=PPC {FinalPPC} PPC >{MakeOutput}
  69.     Execute {MakeOutput}
  70.     Delete {MakeOutput}
  71.  
  72. Clean.Debug     ƒ    $OutOfDate
  73.     Make {Common} {Debug} Remove >{MakeOutput}
  74.     Execute {MakeOutput}
  75.     Delete {MakeOutput}
  76.  
  77. Clean.Final     ƒ    $OutOfDate
  78.     Make {Common} {Final} Remove >{MakeOutput}
  79.     Execute {MakeOutput}
  80.     Delete {MakeOutput}
  81.  
  82. Clean-All.Debug ƒ    $OutOfDate
  83.     Make {Common} {Debug} Remove-All >{MakeOutput}
  84.     Execute {MakeOutput}
  85.     Delete {MakeOutput}
  86.  
  87. Clean-All.Final ƒ    $OutOfDate
  88.     Make {Common} {Final} Remove-All >{MakeOutput}
  89.     Execute {MakeOutput}
  90.     Delete {MakeOutput}
  91.  
  92. #-----------------------------------------------------------------------
  93. # Project Variables
  94. #-----------------------------------------------------------------------
  95.  
  96. Objects            =    :{Dbg}Objects:
  97.  
  98. Sources         =    "{SpriteWorld}Sources:"
  99.  
  100. SWHeaders         =    "{SpriteWorld}Headers:"
  101. BPHeaders        =     "{SpriteWorld}BlitPixie:Headers:"
  102.  
  103. SWLibs             =    "{SpriteWorld}Libraries:"
  104. BPLibs             =     "{SpriteWorld}BlitPixie:Libraries:"
  105.  
  106. LibName68K        =    SpriteWorld{Dbg}Lib.o
  107. LibNamePPC        =    SpriteWorld{Dbg}Lib.x
  108.  
  109. Lib68K          =    {SWLibs}{LibName68K}
  110. LibPPC          =    {SWLibs}{LibNamePPC} 
  111.  
  112. 68K                 ƒ    {Lib68K}
  113. PPC                ƒ    {LibPPC}
  114.  
  115. #-----------------------------------------------------------------------
  116. # Compiler options
  117. #-----------------------------------------------------------------------
  118.  
  119. CC68K             =    {C}            # normally SC
  120. CCPPC            =    {PPCC}        # normally MrC
  121. LINK68K         =    Lib
  122. LINKPPC         =    PPCLink
  123.  
  124. Options            =
  125. Warnings        =    -proto strict -typecheck strict  
  126. IncludesFolders    =    -i {SWHeaders} -i {BPHeaders}
  127.  
  128. CCOptions       =    {IncludesFolders} {Options} {Warnings} -opt {Opt} 
  129. CCOptions68K    =     {CCOptions} {Mbg} -model far
  130. CCOptionsPPC    =     {CCOptions} {Mbg}
  131.  
  132. LibOptions     =     -sym {Sym}
  133. LibOptions68K   =     {LibOptions}
  134. LibOptionsPPC    =     {LibOptions} -xm l
  135.  
  136. #------------------------------------------------------------------------------
  137. # These are the sources that we want to include in the library.
  138. #-------------------------------------------------------------------------------
  139.  
  140. Objects68K    =    ∂
  141.         {Objects}SpriteWorld.c.o ∂
  142.         {Objects}SpriteLayer.c.o ∂
  143.         {Objects}Sprite.c.o ∂
  144.         {Objects}SpriteFrame.c.o ∂
  145.         {Objects}SpriteWorldUtils.c.o ∂
  146.         {Objects}SpriteCompiler.c.o ∂
  147.         {Objects}BlitPixieInterface.c.o ∂
  148.         {Objects}Scrolling.c.o ∂
  149.         {Objects}Tiling.c.o
  150.         
  151. ObjectsPPC    =    ∂
  152.         {Objects}SpriteWorld.c.x ∂
  153.         {Objects}SpriteLayer.c.x ∂
  154.         {Objects}Sprite.c.x ∂
  155.         {Objects}SpriteFrame.c.x ∂
  156.         {Objects}SpriteWorldUtils.c.x ∂
  157.         {Objects}SpriteCompiler.c.x ∂
  158.         {Objects}BlitPixieInterface.c.x ∂
  159.         {Objects}Scrolling.c.x ∂
  160.         {Objects}Tiling.c.x
  161.  
  162. #------------------------------------------------------------------------------
  163. # These are the library objects that we want to include in the library.
  164. #-------------------------------------------------------------------------------
  165.  
  166. Libs68K        =    ∂
  167.         {BPLibs}BlitPixieLib.o
  168.  
  169. LibsPPC        =    ∂
  170.         {BPLibs}BlitPixieLib.x
  171.  
  172. #-----------------------------------------------------------------------
  173. # These are modified default build rules.  
  174. #-----------------------------------------------------------------------
  175.  
  176. {Objects}        ƒ    {Sources}
  177.  
  178. .c.o            ƒ    .c
  179.     Echo "# Compiling {Default}.c using {CC68K} ({Tgt})"
  180.     {CC68K} {CCOptions68K} {DepDir}{Default}.c -o {TargDir}{Default}.c.o 
  181.  
  182. .c.x            ƒ    .c
  183.     Echo "# Compiling {Default}.c using {CCPPC} ({Tgt})"
  184.     {CCPPC} {CCOptionsPPC} {DepDir}{Default}.c -o {TargDir}{Default}.c.x 
  185.  
  186. #-----------------------------------------------------------------------
  187. # The low-level output targets.  
  188. #-----------------------------------------------------------------------
  189.  
  190. {Lib68K}        ƒƒ    {Objects68K}
  191.     Echo "# Linking 680X0 library {LibName68K}"
  192.     {LINK68K} {LibOptions68K} {Objects68K} {Libs68K} -o {Lib68K} 
  193.  
  194. {LibPPC}        ƒƒ    {ObjectsPPC}
  195.     Echo "# Linking PowerPC library {LibNamePPC}"
  196.     {LINKPPC} {LibOptionsPPC} {ObjectsPPC} {LibsPPC} -o {LibPPC} 
  197.  
  198. Remove            ƒ
  199.     Echo "# Removing {Tgt} objects"
  200.     Delete -i {Objects68K} {ObjectsPPC}
  201.  
  202. Remove-All        ƒ    Remove
  203.     Echo "# Removing {Tgt} binaries"
  204.     Delete -i {Lib68K} {LibPPC}
  205.  
  206.